package test.jdkproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class UserServiceInvohander implements InvocationHandler {
    private UserService userService;
    public UserServiceInvohander(UserService userService) {
        this.userService = userService;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("方法开始执行");
        Object obj=method.invoke(userService,args);
        System.out.println("方法结束执行");
        return obj;
    }
}
